package com.iflytek.application.common.springdata.jdbc.converter;

import org.apache.commons.beanutils.BeanUtils;

import java.sql.PreparedStatement;
import java.sql.SQLException;

/**
 * Created by guanxf on 2016/3/11.
 */
public class ResultConverter {

    public  static   void setProperty(Object newObj, Object columObj, String propertyName) throws Exception {
        if (columObj != null) {
            BeanUtils.setProperty(newObj, propertyName, columObj);
        }
    }

    public  static  void setStatemnt(PreparedStatement stmt, int n, Object o) throws SQLException {
        stmt.setObject(n, o);
    }
}
